// 熔断 某个事件监听返回的不是undefined，将会中止执行下一个监听
const { SyncBailHook } = require("tapable")

const hook = new SyncBailHook(["name", "age"])

hook.tap("fn1", function (name, age) {
    console.log(`fn1=====>${name},${age}`)
})


hook.tap("fn2", function (name, age) {
    console.log(`fn2=====>${name},${age}`)
    return "res2"
})

hook.tap("fn3", function (name, age) {
    console.log(`fn3=====>${name},${age}`)
})

hook.call("lx", 25)